home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 22 / PC Actual CD 22.iso / SHARE / prog / POVRAY / ZELTAR-7.ZIP / ZELTAR-7.POV < prev    next >
Encoding:
Text File  |  1997-04-30  |  35.8 KB  |  970 lines

  1.  
  2. ////////////////////////////////////////////////////////////
  3. ///////////////////////////////////////////////////////////
  4. //////////////////////////////////////////////////////////
  5. //
  6. // zeltar-7.pov
  7. //
  8. // Created by Paul T. Dawson <ptdawson@voicenet.com>
  9. //
  10. // March 1, 1997 to April 30, 1997
  11. //
  12. // No copyright - have fun with it!
  13. //
  14. ////////////////////////////////////////////////////////////
  15. ///////////////////////////////////////////////////////////
  16. //////////////////////////////////////////////////////////
  17. //
  18. // WARNING #1 --- This file might *NOT* work in POV-Ray for MS-DOS,
  19. //            --- it causes some strange memory errors.
  20. //            ---
  21. //            --- It does work in POV-Ray for Windows!
  22. //
  23. // WARNING #2 --- This code is really sloppy! 8-)
  24. //
  25. // WARNING #3 --- Run "hf-1.pov" first, to make a 320x200 TGA file.
  26. //
  27. ////////////////////////////////////////////////////////////
  28. ///////////////////////////////////////////////////////////
  29. //////////////////////////////////////////////////////////
  30. //
  31. // Scene switches.
  32.  
  33.  
  34.         #declare fake = 2
  35.         
  36.         #declare Show_Creatures = on
  37.         #declare Show_Fence     = on
  38.         #declare Show_Floor     = on
  39.         #declare Show_Mountains = on
  40.         #declare Show_School    = on
  41.         #declare Show_Sign      = on
  42.         #declare Show_Sky       = on
  43.         #declare Show_Tracks    = on
  44.  
  45.         // Note: The "fake" variable is used to substitute a simple
  46.         //       shape for the actual final object. For example, the
  47.         //       spirals on the fence (with 12,000 triangles each) are
  48.         //       replaced with a single cone. This speeds up testing!
  49.         //
  50.         //       In this scene, "fake" works for Show_Creatures,
  51.         //       Show_Fence, Show_Mountains, and Show_Tracks.
  52.  
  53.  
  54. ////////////////////////////////////////////////////////////
  55. ///////////////////////////////////////////////////////////
  56. //////////////////////////////////////////////////////////
  57. //
  58. // All the usual stuff.
  59.  
  60.  
  61.         #include "colors.inc"
  62.         #include "textures.inc"
  63.         #include "golds.inc"
  64.         #include "skies.inc"
  65.         #include "stars.inc"
  66.  
  67.         #default { finish { Shiny } }
  68.  
  69.         #declare R = seed(0)
  70.  
  71.         light_source{< 10, 15, -10 > color rgb 1 }
  72.         light_source{< -100, 100 , 0 > color rgb 1 }
  73.         
  74.         background { White }
  75.  
  76.  
  77. ////////////////////////////////////////////////////////////
  78. ///////////////////////////////////////////////////////////
  79. //////////////////////////////////////////////////////////
  80. //
  81. // Set up the camera.
  82.  
  83.  
  84.         // Wide view.
  85.         //camera{location<50 ,100 ,-120 > look_at <50, 30 ,50> }
  86.         
  87.         // Final.
  88.         camera{location<10 ,15 ,-10 > look_at <50, 0 ,50> }
  89.  
  90.  
  91. ////////////////////////////////////////////////////////////
  92. ///////////////////////////////////////////////////////////
  93. //////////////////////////////////////////////////////////
  94. //
  95. // The strange creatures.
  96.  
  97.  
  98. #if ( Show_Creatures = fake )
  99.  
  100.         #declare Creature = union {
  101.                 cylinder{<0,-1,0><0,2,0>,1 pigment{Gray70}}
  102.                 cone{<0,2,0>,0.75<0,5,0>,1.5 pigment{Gray40}}
  103.                 cone{<0,5,0>,1.5<0,6,0>,1.0 pigment{Gray10}}
  104.                 } // End of union.
  105.  
  106. #end // End of if block.
  107.  
  108.  
  109. #if ( Show_Creatures = on )
  110.  
  111.         #declare Half_Cone_1 = difference {
  112.  
  113.                 union {
  114.                 cone { <0,0,0>,1.5 <0,0,-0.5>,1 }
  115.                 cylinder{<0,0,0><0,0,0.5>,1.5 }
  116.                 } // End of union.
  117.  
  118.                 cone { <0,0,-0.501>,1 <0,0,-0.25>,0.8 }
  119.  
  120.                 box { < -2, -2, 0.6 > < 2, 0, -0.6 > }
  121.  
  122.                 } // End of difference.
  123.  
  124.         #declare Half_Cone_2 = difference {
  125.  
  126.                 union {
  127.                 cone { <0,0,0>,1.1 <0,0,-0.5>,0.75 }
  128.                 cylinder{<0,0,0><0,0,0.5>,1.1}
  129.                 } // End of union.
  130.  
  131.                 cone { <0,0,-0.501>,0.75 <0,0,-0.25>,0.6 }
  132.  
  133.                 box { < -2, 2, 0.6 > < 2, 0, -0.6 > }
  134.                 
  135.                 } // End of difference.
  136.  
  137.         // Twelve points for connecting triangles.
  138.                 #declare VEC_1 = < -1.5, 4.5, 0 >
  139.                 #declare VEC_2 = < -1.0, 4.5, -0.5  >
  140.                 #declare VEC_3 = < -0.8, 4.5, -0.25 >
  141.                 #declare VEC_4 = <  0.8, 4.5, -0.25 >
  142.                 #declare VEC_5 = <  1.0, 4.5, -0.5  >
  143.                 #declare VEC_6 = <  1.5, 4.5, 0 >
  144.  
  145.                 #declare VEC_7  = < -1.1, 2.75, 0 >
  146.                 #declare VEC_8  = < -0.75, 2.75, -0.5 >
  147.                 #declare VEC_9  = < -0.6, 2.75, -0.25 >
  148.                 #declare VEC_10 = <  0.6, 2.75, -0.25 >
  149.                 #declare VEC_11 = <  0.75, 2.75, -0.5 >
  150.                 #declare VEC_12 = <  1.1, 2.75, 0 >
  151.  
  152.                 #declare VEC_B1 = < -1.5, 4.5, 0.5 >
  153.                 #declare VEC_B2 = < 1.5, 4.5, 0.5 >
  154.                 #declare VEC_B3 = < -1.1, 2.75, 0.5 >
  155.                 #declare VEC_B4 = < 1.1, 2.75, 0.5 >
  156.  
  157.         #declare One_Arm = union {
  158.                 
  159.                 #declare TEMP = 0 #while ( TEMP <=5 )
  160.  
  161.                         sphere { 0,0.1 pigment { Gray30 }
  162.                         translate < TEMP*0.2, (sin(TEMP)/2),0 > }
  163.  
  164.                 #declare TEMP = TEMP + 0.1 #end
  165.                         
  166.                 // The hand.
  167.                 sphere { 0,0.2 pigment{Gray10}
  168.                 translate < TEMP*0.2, (sin(TEMP)/2),0 > }
  169.  
  170.                 } // End of union.
  171.  
  172.         #declare Base = union {
  173.         
  174.                 // Main body.
  175.                 cylinder { <0,0,0><0,2,0>, 0.75 pigment{Gray50} }
  176.                 
  177.                 // Lid.
  178.                 cylinder { <0,1.8,0><0,2,0>, 0.8 pigment{Gray30} }
  179.  
  180.                 // Neck.
  181.                 cone { <0,2,0>,0.4 <0,3,0>,0.1 pigment {Gray10} }
  182.  
  183.                 // Vertical ribs.
  184.                 #declare TEMP = 0 #while ( TEMP < 360 )
  185.                         sphere{0,0.75 scale <0.1,1,0.1> translate <0.75,1,0>
  186.                         rotate y*TEMP pigment{Gray20} }
  187.                 #declare TEMP = TEMP + 36 #end
  188.                 
  189.                 // Wheels.
  190.                 #declare TEMP = 0 #while ( TEMP < 360 )
  191.                         
  192.                         union {
  193.                                 sphere{0,0.2 pigment{Black} }
  194.                                 
  195.                                 cylinder { <0,0,0> <-0.3,0.8,0>, 0.1
  196.                                 pigment{Gray30}}
  197.                                 
  198.                                 translate <0.55,-0.8,0>
  199.                                 rotate y*TEMP
  200.                                 
  201.                                 } // End of union.
  202.  
  203.                 #declare TEMP = TEMP + (360/5) #end
  204.                 
  205.                 } // End of union.
  206.  
  207.         #declare One_Eye = union {
  208.                 
  209.                 sphere { 0, 0.4
  210.                 scale < 1, 0.6, 0.4 > pigment{White}}
  211.                 
  212.                 sphere { 0,0.15 translate <0,0,-0.1> pigment{OrangeRed}}
  213.  
  214.                 } // End of union.
  215.         
  216.         #declare The_Nose = difference {
  217.                 
  218.                 sphere { 0,0.8 scale <0.3,1,0.3 >}
  219.                 box{<-1,-0.2,-1><1,-1,1>}
  220.  
  221.                 } // End of difference.
  222.  
  223.         #declare The_Mouth = union {
  224.         
  225.                 difference {
  226.                         sphere { 0,1 scale < 1, 0.7, 0.5 > }
  227.                         box { <-2,-0.2,-2><2,0.2,2> }
  228.                         } // End of difference.
  229.                 
  230.                 cylinder { <0,-0.2,0><0,0.2,0>,0.7
  231.                         scale < 1, 1, 0.5 >
  232.                         pigment{checker White,Gray70 scale < 0.1, 11, 11> } }
  233.                 
  234.                 } // End of union.
  235.  
  236.         // Put it all together.
  237.         
  238.         #declare Creature = union {
  239.         
  240.         object{Half_Cone_1 translate y*4.5  }
  241.         
  242.         object{Half_Cone_2 translate y*2.75  }
  243.  
  244.         object { One_Eye translate < -0.5, 4.5, -0.25 > }
  245.         object { One_Eye translate <  0.5, 4.5, -0.25 > }
  246.  
  247.         object { Base translate y *-0.5 }
  248.  
  249.         object { One_Arm rotate x*50 translate < 0.75, 1.6, 0 >
  250.                 translate y *-0.5 }
  251.         object { One_Arm rotate y*180 rotate x*50
  252.                 translate < -0.75, 1.6, 0 > translate y *-0.5 }
  253.  
  254.         object { The_Nose translate <0,3.8,-0.25> }
  255.  
  256.         object { The_Mouth translate < 0, 2.8, -0.1 > }
  257.  
  258.         // Back side fan shaped boxes.
  259.         #declare TEMP = -15 #while ( TEMP <= 15 )
  260.  
  261.                 union { box { < -0.02, 1, 0.5 > < 0.02, 4, 0.7 > }
  262.                         cylinder { <-0.02,4,0.5><0.02,4,0.5>,0.2 }
  263.                         rotate z * TEMP
  264.                         translate < 0, 1.1, 0 >
  265.                         pigment { Gray50 }
  266.                         } // End of union.
  267.  
  268.         #declare TEMP = TEMP + 5 #end
  269.  
  270.         // Connect the two differenced cone halves.
  271.         triangle { VEC_1, VEC_2, VEC_7 }
  272.         triangle { VEC_2, VEC_7, VEC_8 }
  273.         triangle { VEC_2, VEC_3, VEC_8 }
  274.         triangle { VEC_3, VEC_8, VEC_9 }
  275.         triangle { VEC_3, VEC_4, VEC_9 }
  276.         triangle { VEC_4, VEC_9, VEC_10 }
  277.         triangle { VEC_4, VEC_5, VEC_10 }
  278.         triangle { VEC_5, VEC_10, VEC_11 }
  279.         triangle { VEC_5, VEC_6, VEC_11 }
  280.         triangle { VEC_6, VEC_11, VEC_12 }
  281.  
  282.         // Connect the two cylinders.
  283.         triangle { VEC_1,  VEC_B1, VEC_7  }
  284.         triangle { VEC_B1, VEC_B3, VEC_7  }
  285.         triangle { VEC_6,  VEC_B2, VEC_12 }
  286.         triangle { VEC_B2, VEC_B4, VEC_12 }
  287.  
  288.         // Fill in back opening.
  289.         triangle { VEC_B1, VEC_B2, VEC_B3 }
  290.         triangle { VEC_B2, VEC_B3, VEC_B4  }
  291.  
  292.         pigment { Gray70 }
  293.         normal { crackle 0.3 scale 0.1 }
  294.  
  295.         translate y * 0.5 
  296.  
  297.         } // End of union.
  298.  
  299. #end // End of if block.
  300.  
  301.  
  302. #ifdef ( Creature )
  303.  
  304.         // Left side - facing camera.
  305.         object{Creature translate<21, 2, 54 >}
  306.         object{Creature translate<21, 2, 34 >}
  307.         object{Creature translate<21, 2, 12+3 >}
  308.         
  309.         // Left side - facing away from camera.
  310.         object{Creature rotate y*180 translate<25, 2, 3 >}
  311.  
  312.         // Left to right road - facing negative x.
  313.         object{Creature rotate y*90 translate<41, 2, 21 >}
  314.         object{Creature rotate y*90 translate<66, 2, 21 >}
  315.         
  316.         // Left to right road - facing positive x.
  317.         object{Creature rotate y*-90 translate<13, 2, 17 >}
  318.         object{Creature rotate y*-90 translate<49, 2, 17 >}
  319.         
  320.         // Driving out of school.
  321.         object{Creature translate<52, 2, 26 >}
  322.  
  323. #end // End of if block.
  324.  
  325.  
  326. ////////////////////////////////////////////////////////////
  327. ///////////////////////////////////////////////////////////
  328. //////////////////////////////////////////////////////////
  329. //
  330. // The fence around the school.
  331.  
  332.  
  333. #if ( Show_Fence = on )
  334.  
  335.  
  336. // Make the spiral things.
  337.  
  338.         #declare COUNT = 0
  339.         
  340.         #declare Half_Spiral_Thing = mesh {
  341.  
  342.                 #declare A = 0 #while ( A <= 10 )
  343.  
  344.                         #declare YROT = A * 360
  345.                         #declare X1 = 1.01 - ( A/10 )
  346.                         
  347.                         // First triangle.
  348.                         #declare V1=vrotate ( <X1,A,0>,<0,YROT,0> )
  349.                         #declare V2=vrotate ( <X1+0.1,A+0.1,0>,<0,YROT,0> )
  350.                         #declare V3=vrotate ( <X1+0.2,A,0>,<0,YROT,0> )
  351.                         triangle{ V1,V2,V3 }
  352.                         #declare COUNT=COUNT+1
  353.                         
  354.                         // Second triangle.
  355.                         #declare V1=vrotate ( <X1,A,0>,<0,YROT,0> )
  356.                         #declare V2=vrotate ( <X1+0.1,A+0.1,0>,<0,YROT,0> )
  357.                         #declare V3=vrotate ( <X1+0.1,A,0.1>,<0,YROT,0> )
  358.                         triangle{ V1,V2,V3 }
  359.                         #declare COUNT=COUNT+1
  360.                         
  361.                         // Third triangle.
  362.                         #declare V1=vrotate ( <X1+0.2,A,0>,<0,YROT,0> )
  363.                         #declare V2=vrotate ( <X1+0.1,A+0.1,0>,<0,YROT,0> )
  364.                         #declare V3=vrotate ( <X1+0.1,A,0.1>,<0,YROT,0> )
  365.                         triangle{ V1,V2,V3 }
  366.                         #declare COUNT=COUNT+1
  367.  
  368.                 #declare A = A + 0.005 #end
  369.  
  370.                 pigment { color rgb < 0.4, 0, 0 > }
  371.                 finish { F_MetalA }
  372.                 
  373.         } // End of mesh.
  374.  
  375.         #declare Spiral_Thing = union {
  376.  
  377.                 object { Half_Spiral_Thing }
  378.                 object { Half_Spiral_Thing rotate y*180 }
  379.  
  380.                 scale < 0.4, 0.6, 0.4 >
  381.  
  382.                 } // End of union.
  383.  
  384.         #declare COUNT = COUNT * 2
  385.         #debug "There are "
  386.         #debug str ( COUNT, 0, 0 )
  387.         #debug " triangles in one spiral thing!\n"
  388.         
  389.         #declare Fence_Section = union {
  390.         box { <-0.5,-10,-0.5><0.5,1,0.5>
  391.                 pigment { color rgb < 1.0, 0.8, 0.8 > }
  392.                 normal { crackle 0.1 scale < 0.1, 0.1, 100 > } }
  393.         object { Spiral_Thing translate < 0, 0.75, 0 > }
  394.         } // End of union.
  395.  
  396. #end // End of if block.
  397.  
  398. #if ( Show_Fence = fake )
  399.         
  400.         #declare Fence_Section = union {
  401.         box { <-0.5,-10,-0.5><0.5,1,0.5>
  402.                 pigment { color rgb < 1.0, 0.8, 0.8 > } }
  403.         cone { <0,1,0>,0.5 <0,6,0>,0 pigment { Yellow } }
  404.         } // End of union.
  405.  
  406. #end // End of if block.
  407.  
  408.  
  409. #ifdef ( Fence_Section )
  410.  
  411.         #declare COUNT2 = 0
  412.         
  413.         #declare X=20 #while (X<=40)
  414.                 object{Fence_Section rotate y*(int(rand(R)*4)*90)
  415.                         translate <X+10,0,20+10>}
  416.                 object{Fence_Section rotate y*(int(rand(R)*4)*90)
  417.                         translate <X+10,0,60+10>}
  418.                 #declare COUNT2 = COUNT2 + 2
  419.         #declare X=X+1 #end
  420.  
  421.         #declare X=50 #while (X<=70)
  422.                 object{Fence_Section rotate y*(int(rand(R)*4)*90)
  423.                         translate <X+10,0,20+10>}
  424.                 object{Fence_Section rotate y*(int(rand(R)*4)*90)
  425.                         translate <X+10,0,60+10>}
  426.                 #declare COUNT2 = COUNT2 + 2
  427.         #declare X=X+1 #end
  428.  
  429.         #declare Z = 21 #while(Z<=59)
  430.                 object{Fence_Section rotate y*(int(rand(R)*4)*90)
  431.                         translate <20+10,0,Z+10>}
  432.                 object{Fence_Section rotate y*(int(rand(R)*4)*90)
  433.                         translate <70+10,0,Z+10>}
  434.                 #declare COUNT2 = COUNT2 + 2
  435.         #declare Z=Z+1 #end
  436.  
  437.         #if ( Show_Fence = on )
  438.                 #declare GRANDTOTAL = COUNT * COUNT2
  439.                 #debug "Grand total of fence triangles is "
  440.                 #debug str ( GRANDTOTAL, 0, 0 )
  441.                 #debug ".\n"
  442.         #end // End of if block.
  443.  
  444. #end // End of if block.
  445.  
  446.  
  447. ////////////////////////////////////////////////////////////
  448. ///////////////////////////////////////////////////////////
  449. //////////////////////////////////////////////////////////
  450. //
  451. // The floor (?), created by "HF-1.POV" (320x200 TGA).
  452.  
  453.  
  454. #if ( Show_Floor = on )
  455.  
  456.         height_field { tga "hf-1.tga"
  457.  
  458.                 scale < 100, 9, 100 >
  459.                 pigment { color rgb < 0.6, 0.1, 0.1 > }
  460.                 normal { crackle 0.5 scale 0.1 }
  461.                 smooth
  462.                 translate y * -10
  463.  
  464.                 } // End of height_field.
  465.  
  466. #end // End of if block.
  467.  
  468.  
  469. ////////////////////////////////////////////////////////////
  470. ///////////////////////////////////////////////////////////
  471. //////////////////////////////////////////////////////////
  472. //
  473. // Mountains in background.
  474.  
  475.  
  476. #if ( Show_Mountains = fake )
  477.  
  478.         box{<-100,-1,110><150,25,111>pigment{Brown}}
  479.         box{< 110,-1,-10><111,25,150>pigment{Brown}}
  480.  
  481. #end // End of if block.
  482.  
  483. #if ( Show_Mountains = on )
  484.  
  485.         #declare Far_Away = height_field { gif "hf-2.gif"
  486.                 scale < 100, 24, 100 >
  487.                 pigment { color rgb < 0.6, 0.1, 0.1 > }
  488.                 normal { crackle 0.5 scale 0.1 }
  489.                 smooth
  490.                 translate y * -10
  491.                 } // End of height_field.
  492.  
  493.         #declare Far_Away2 = object { Far_Away
  494.                 rotate y * 180 translate < 100, 0, 100 > }
  495.         
  496.         // First row - behind camera.
  497.         object { Far_Away  scale <1,3,1> translate < -100, 0, -100 > }
  498.         object { Far_Away2 scale <1,3,1> translate <    0, 0, -100 > }
  499.         object { Far_Away  scale <1,3,1> translate <  100, 0, -100 > }
  500.         object { Far_Away2 scale <1,3,1> translate <  200, 0, -100 > }
  501.         object { Far_Away  scale <1,3,1> translate <  300, 0, -100 > }
  502.  
  503.         // Second row - aligned with floor piece.
  504.         object { Far_Away2 scale <1,3,1> translate < -100, 0,   0 > }
  505.         object { Far_Away                translate <  100, 0,   0 > }
  506.         object { Far_Away  scale <1,3,1> translate <  200, 0,   0 > }
  507.  
  508.         // Third row - behind floor.
  509.         object { Far_Away2 scale <1,3,1> translate < -100, 0, 100 > }
  510.         object { Far_Away                translate <    0, 0, 100 > }
  511.         object { Far_Away2               translate <  100, 0, 100 > }
  512.         object { Far_Away  scale <1,3,1> translate <  200, 0, 100 > }
  513.         object { Far_Away2 scale <1,3,1> translate <  300, 0, 100 > }
  514.  
  515.         // Fourth row.
  516.         object { Far_Away  scale <1,3,1> translate < -100, 0, 200 > }
  517.         object { Far_Away2 scale <1,3,1> translate <    0, 0, 200 > }
  518.         object { Far_Away  scale <1,3,1> translate <  100, 0, 200 > }
  519.         object { Far_Away2 scale <1,3,1> translate <  200, 0, 200 > }
  520.         object { Far_Away  scale <1,3,1> translate <  300, 0, 200 > }
  521.  
  522. #end // End of if block.
  523.  
  524.  
  525. ////////////////////////////////////////////////////////////
  526. ///////////////////////////////////////////////////////////
  527. //////////////////////////////////////////////////////////
  528. //
  529. // The school.
  530.  
  531.  
  532. #if ( Show_School = on )
  533.  
  534.         // Make the "brick".
  535.  
  536.         #declare Goofy_Brick = height_field { gif "hf-3.gif"
  537.                 scale < 2, 0.3, 2 >
  538.                 texture { T_Gold_1A }
  539.                 normal { crackle 0.1 scale < 0.2, 10, 0.2 > }
  540.                 smooth
  541.                 rotate x * -90
  542.                 } // End of height_field.
  543.  
  544.         #declare Big_Brick = union {
  545.                 object { Goofy_Brick translate <2,0,0>}
  546.                 object { Goofy_Brick rotate z * 90 translate <2,0,0>}
  547.                 object { Goofy_Brick translate <0,2,0> }
  548.                 object { Goofy_Brick rotate z*90 translate <4,2,0>}
  549.                 } // End of union.
  550.  
  551.         // Front of school.
  552.         #declare Y = -12 #while ( Y <= 16 )
  553.         #declare X = 40 #while ( X <= 68 )
  554.  
  555.                 object { Big_Brick translate < X, Y, 40 > }
  556.         
  557.         #declare X = X + 4 #end
  558.         #declare Y = Y + 4 #end
  559.  
  560.         // Side of school.
  561.         #declare Y = -12 #while ( Y <= 16 )
  562.         #declare Z = 40 #while ( Z <= 56 )
  563.  
  564.                 object { Big_Brick
  565.                         translate x * -4
  566.                         rotate y * 90
  567.                         translate < 40, Y, Z > }
  568.         
  569.         #declare Z = Z + 4 #end
  570.         #declare Y = Y + 4 #end
  571.  
  572.         // Roof panels.
  573.         mesh {
  574.                 #declare ZZZ = 0 #while (ZZZ<=20)
  575.                 triangle{<0,20,ZZZ><32,20,ZZZ><16,30,ZZZ>}
  576.                 #declare ZZZ=ZZZ+0.25 #end
  577.  
  578.                 translate < 40, 0, 40 >
  579.  
  580.                 texture { T_Gold_1A }
  581.  
  582.                 normal { crackle 0.1 scale < 0.2, 10, 0.2 > }
  583.  
  584.                 } // End of mesh.
  585.  
  586.         // Use some "trees" for antennas on the roof.
  587.         // The section uses the "ptd_tree.inc" nested loop trees!
  588.  
  589.         #declare TREE_RAND = seed(0)
  590.         #declare Wiggle_Flag = off
  591.         #declare Branches_On_End_Flag = on
  592.         #declare Number_Of_Large_Branches = 7
  593.         #declare Number_Of_Medium_Branches = 2
  594.         #declare Number_Of_Small_Branches = 2
  595.         #declare Large_Branch_Minimum_Angle = 90
  596.         #declare Large_Branch_Maximum_Angle = 90
  597.         #declare Medium_Branch_Minimum_Angle = 80
  598.         #declare Medium_Branch_Maximum_Angle = 80
  599.         #declare Small_Branch_Minimum_Angle = 90
  600.         #declare Small_Branch_Maximum_Angle = 90
  601.         #declare Tree_Trunk_Size = 14
  602.         #declare Large_Branch_Size_Min = 2.5
  603.         #declare Large_Branch_Size_Max = 2.5
  604.         #declare Medium_Branch_Size_Min = 5
  605.         #declare Medium_Branch_Size_Max = 5
  606.         #declare Small_Branch_Size_Min = 0.5
  607.         #declare Small_Branch_Size_Max = 0.5
  608.  
  609.         // Use a negative number for the leaf style,
  610.         // then define a custom leaf type.
  611.         #declare Leaf_Type = -1
  612.         #declare TEMP_TEX = texture {
  613.                 checker texture{T_Gold_1A}, texture{T_Gold_5E} }
  614.         #declare One_Leaf = union {
  615.                 torus { 1, 0.15 texture { TEMP_TEX scale 10 } }
  616.                 cylinder { < -1, 0,  0 > < 1, 0, 0 >, 0.05
  617.                         pigment { Gray30 } }
  618.                 cylinder { <  0, 0, -1 > < 0, 0, 1 >, 0.05
  619.                         pigment { Gray30 } }
  620.                 } // End of union.
  621.  
  622.         #declare TREE_MESH_SIZE = 300
  623.         #declare Leaf_Texture = texture { pigment { White } }
  624.         #declare Bark_Texture = texture { T_Gold_5E }
  625.         #include "ptd_tree.inc"
  626.  
  627.         // Left side antennas.
  628.         object { Complete_Tree scale 0.5 translate < 41, 19, 41 > }
  629.         object { Complete_Tree scale 0.5 translate < 41, 19, 50 > }
  630.         object { Complete_Tree scale 0.5 translate < 41, 19, 59 > }
  631.         
  632.         // Right side antennas.
  633.         object { Complete_Tree scale 0.5 translate < 71, 19, 41 > }
  634.         object { Complete_Tree scale 0.5 translate < 71, 19, 50 > }
  635.         object { Complete_Tree scale 0.5 translate < 71, 19, 59 > }
  636.  
  637.         // Front door.
  638.         box { < 49,-3,39.00><63,11,41> pigment { Gray20}
  639.         normal { crackle 0.2 scale 0.1 } finish { F_MetalA}}
  640.  
  641.         box { < 50,-2,38.99><55.9,10,39>
  642.                 pigment { White } finish { Mirror reflection 0.6 } }
  643.         box { < 56.1,-2,38.99><62,10,39>
  644.                 pigment { White } finish { Mirror reflection 0.6 } }
  645.  
  646.         // Sign over front door.
  647.  
  648.                 box { < 47, 12, 39.5><65,16,41>
  649.                         normal { crackle 0.2 scale 0.1 }
  650.                         pigment { Gray20 }
  651.                         finish { F_MetalA }
  652.                         } // End of box.
  653.  
  654.                 height_field { gif "sign-2.gif"
  655.                         scale < 16, 0.5, 3 >
  656.                         rotate x * -90
  657.                         pigment {image_map { gif "sign-2.gif"
  658.                                 interpolate 2 once } scale <16,3,1>}
  659.                         smooth
  660.                         translate < 48, 12.5, 39.5 >
  661.                         } // End of height_field.
  662.  
  663. #end // End of if block.
  664.  
  665.  
  666. ////////////////////////////////////////////////////////////
  667. ///////////////////////////////////////////////////////////
  668. //////////////////////////////////////////////////////////
  669. //
  670. // The sign.
  671.  
  672. #if ( Show_Sign = on )
  673.  
  674.         #declare The_Sign = union {
  675.         
  676.         // The words.
  677.         box{ <0,0,0><1,1,0.1>
  678.                 pigment{image_map { gif "sign-1.gif"
  679.                         interpolate 2 once } }
  680.                 scale < 8, 3, 1 >
  681.                 } // End of box.
  682.  
  683.         // Outer frame.
  684.         difference {
  685.                 box { < -0.1, -0.1, -0.1 > < 8.1, 3.1, 1.0 > }
  686.                 box { <  0,    0,   -0.2 > < 8.0, 3.0, 0.2 > }
  687.                 pigment { Gray30 }
  688.                 finish { F_MetalA }
  689.                 } // End of difference.
  690.  
  691.         // Posts.
  692.         #declare TEMP = 1 #while ( TEMP <= 7 )
  693.  
  694.                 cylinder { < TEMP, -0.1, 0.5 > < TEMP, -20, 0.5 >, 0.2
  695.                         pigment { Red }
  696.                         finish { F_MetalE } }
  697.  
  698.                 #declare TEMP2 = -0.5 #while ( TEMP2 > -20 )
  699.  
  700.                         torus { 0.4, 0.03
  701.                                 texture { T_Gold_5E }
  702.                                 translate < TEMP, TEMP2, 0.5 > }
  703.  
  704.                 #declare TEMP2 = TEMP2 - 0.25 #end
  705.  
  706.         #declare TEMP = TEMP + 2 #end
  707.  
  708.         } // End of union.
  709.  
  710.         object { The_Sign scale 1.4 translate < 32-2, 2, 26 > }
  711.  
  712. #end // End of if block.
  713.  
  714.  
  715. ////////////////////////////////////////////////////////////
  716. ///////////////////////////////////////////////////////////
  717. //////////////////////////////////////////////////////////
  718. //
  719. // The sky.
  720.  
  721.  
  722. #if ( Show_Sky = on )
  723.  
  724.         sphere{ < 0, -4000, 0 >, 5000
  725.                 texture { Starfield2 }
  726.                 finish { Luminous }
  727.                 hollow }
  728.  
  729. #end // End of if block.
  730.  
  731.  
  732. ////////////////////////////////////////////////////////////
  733. ///////////////////////////////////////////////////////////
  734. //////////////////////////////////////////////////////////
  735. //
  736. // The tracks that the creatures travel on.
  737.  
  738.  
  739. #if ( Show_Tracks = fake )
  740.  
  741.         #declare Track_1 = union {
  742.                 box{<0,0.5,0><2,1,2> pigment{Maroon}}
  743.                 cylinder{<1,-10,1><1,0.5,1>,0.1 texture{T_Gold_1A}} }
  744.         
  745.         #declare Track_2 = union {
  746.                 box{<0,0.5,0><2,1,2> pigment{Gray30}}
  747.                 cylinder{<1,-10,1><1,0.5,1>,0.1 texture{T_Gold_1A}} }
  748.  
  749.         #declare Track_3 = union {
  750.                 box{<0,0.5,0><2,1,2> pigment{Cyan}}
  751.                 cylinder{<1,-10,1><1,0.5,1>,0.1 texture{T_Gold_1A}} }
  752.  
  753. #end // End of if block.
  754.  
  755.  
  756. #if ( Show_Tracks = on )
  757.  
  758.         #declare TEMP_TEX_1 = texture {
  759.                 pigment{color rgb<0.6,0.2,0.2> } finish{F_MetalA}}
  760.  
  761.         #declare TEMP_TEX_2 = texture {
  762.                 pigment{color rgb<0.8,0.4,0.4> } finish{F_MetalA}}
  763.  
  764.         // This is the "straight line" track.
  765.  
  766.         #declare Track_1 = mesh {
  767.  
  768.                 #declare Y = 0.3 #while ( Y <= 0.9 )
  769.                 
  770.                 // Sides of box.        
  771.                         triangle { <0,Y,0><2,Y,0><2,Y+0.1,0>
  772.                         texture { T_Gold_1A} }
  773.                         triangle { <0,Y,0><0,Y+0.1,0><2,Y+0.1,0>
  774.                         texture { T_Gold_1A} }
  775.                 
  776.                         triangle { <0,Y,2><2,Y,2><2,Y+0.1,2>
  777.                         texture { T_Gold_1A} }
  778.                         triangle { <0,Y,2><0,Y+0.1,2><2,Y+0.1,2>
  779.                         texture { T_Gold_1A} }
  780.                 
  781.                 // Flat top of box.
  782.                         triangle { <0,Y+0.1,0><2,Y+0.1,0><2,Y+0.1,2>
  783.                         texture { T_Gold_1A} }
  784.                         triangle { <0,Y+0.1,0><0,Y+0.1,2><2,Y+0.1,2>
  785.                         texture { T_Gold_1A} }
  786.                 
  787.                 #declare Y = Y + 0.3 #end
  788.  
  789.                 // Rails.
  790.                 #declare X = 0 #while ( X <= 2 )
  791.                         triangle { <X,1.2,0><X,1,0.2><X,1,0>
  792.                                 texture{TEMP_TEX_1} }
  793.                         triangle { <X,1.2,2><X,1,1.8><X,1,2>
  794.                                 texture{TEMP_TEX_1} }
  795.                 #declare X = X + 0.01 #end
  796.  
  797.                 // Post.
  798.                 #declare Y = -10 #while ( Y <= 0.3 )
  799.                 
  800.                 #declare V1 = vrotate(< 0.4,Y, 0.0>,<0,Y*100,0>)
  801.                 #declare V2 = vrotate(< 0.0,Y, 0.2>,<0,Y*100,0>)
  802.                 #declare V3 = vrotate(<-0.2,Y, 0.0>,<0,Y*100,0>)
  803.                 #declare V4 = vrotate(< 0.0,Y,-0.2>,<0,Y*100,0>)
  804.                 #declare V5 = < 0, Y-0.1, 0 >
  805.  
  806.                 #declare V1 = V1 + <1,0,1>
  807.                 #declare V2 = V2 + <1,0,1>
  808.                 #declare V3 = V3 + <1,0,1>
  809.                 #declare V4 = V4 + <1,0,1>
  810.                 #declare V5 = V5 + <1,0,1>
  811.  
  812.                 triangle { V1, V2, V5 texture { T_Gold_1A } }
  813.                 triangle { V2, V3, V5 texture { T_Gold_1A } }
  814.                 triangle { V3, V4, V5 texture { T_Gold_1A } }
  815.                 triangle { V4, V1, V5 texture { T_Gold_1A } }
  816.  
  817.                 #declare Y = Y + 0.1 #end
  818.  
  819.         } // End of mesh.
  820.  
  821.         // Sideways track.
  822.         
  823.         #declare Track_2 = object { Track_1
  824.                 
  825.                 translate < -1, 0, -1 >
  826.                 rotate y * 90
  827.                 translate < 1, 0, 1 >
  828.                 
  829.                 } // End of object.
  830.  
  831.         // Four way intersection track (computer controlled).
  832.         
  833.         #declare Track_3 = union {
  834.                 
  835.                 #declare TEMP = 0.3 #while ( TEMP <= 0.9 )
  836.                         cylinder{<1, TEMP, 1><1,TEMP+0.1, 1>,1.5+0.5
  837.                                 texture{T_Gold_1A} }
  838.                 #declare TEMP = TEMP + 0.3 #end
  839.                 
  840.                 #declare Y = -10 #while ( Y <= 0.3 )
  841.                 
  842.                 #declare V1 = vrotate(< 0.4,Y, 0.0>,<0,Y*100,0>)
  843.                 #declare V2 = vrotate(< 0.0,Y, 0.2>,<0,Y*100,0>)
  844.                 #declare V3 = vrotate(<-0.2,Y, 0.0>,<0,Y*100,0>)
  845.                 #declare V4 = vrotate(< 0.0,Y,-0.2>,<0,Y*100,0>)
  846.                 #declare V5 = < 0, Y-0.1, 0 >
  847.  
  848.                 #declare V1 = V1 + <1,0,1>
  849.                 #declare V2 = V2 + <1,0,1>
  850.                 #declare V3 = V3 + <1,0,1>
  851.                 #declare V4 = V4 + <1,0,1>
  852.                 #declare V5 = V5 + <1,0,1>
  853.  
  854.                 triangle { V1, V2, V5 texture { T_Gold_1A } }
  855.                 triangle { V2, V3, V5 texture { T_Gold_1A } }
  856.                 triangle { V3, V4, V5 texture { T_Gold_1A } }
  857.                 triangle { V4, V1, V5 texture { T_Gold_1A } }
  858.  
  859.                 #declare Y = Y + 0.1 #end
  860.                 
  861.                 // Bunch of corner posts.
  862.                 cylinder{<0-0.2,1,0-0.2><0-0.2,2,0-0.2>,0.08 texture{T_Gold_5E}}
  863.                 cylinder{<2+0.2,1,0-0.2><2+0.2,2,0-0.2>,0.08 texture{T_Gold_5E}}
  864.                 cylinder{<2+0.2,1,2+0.2><2+0.2,2,2+0.2>,0.08 texture{T_Gold_5E}}
  865.                 cylinder{<0-0.2,1,2+0.2><0-0.2,2,2+0.2>,0.08 texture{T_Gold_5E}}
  866.                 
  867.                 cone{<0-0.2,2,0-0.2>,0.08<0-0.2,2.3,0-0.2>,0 texture{T_Gold_1A}}
  868.                 cone{<2+0.2,2,0-0.2>,0.08<2+0.2,2.3,0-0.2>,0 texture{T_Gold_1A}}
  869.                 cone{<2+0.2,2,2+0.2>,0.08<2+0.2,2.3,2+0.2>,0 texture{T_Gold_1A}}
  870.                 cone{<0-0.2,2,2+0.2>,0.08<0-0.2,2.3,2+0.2>,0 texture{T_Gold_1A}}
  871.                 
  872.                 } // End of union.
  873.  
  874. #end // End of if block.
  875.  
  876.  
  877. #if ( Show_Tracks != off )
  878.  
  879.         // Start the big loop.
  880.  
  881.         #declare A=1 #while (A<=50)
  882.         
  883.         #declare ZZ=""
  884.  
  885.         #if(A= 1) #declare ZZ=".................................................." #end
  886.         #if(A= 2) #declare ZZ=".................................................." #end
  887.         #if(A= 3) #declare ZZ=".................................................." #end
  888.         #if(A= 4) #declare ZZ=".................................................." #end
  889.         #if(A= 5) #declare ZZ="..........+-+--------------------................." #end
  890.         #if(A= 6) #declare ZZ="..........I.I....................................." #end
  891.         #if(A= 7) #declare ZZ="..........+-+--------------------................." #end
  892.         #if(A= 8) #declare ZZ="..........I.I....................................." #end
  893.         #if(A= 9) #declare ZZ="..........I.I....................................." #end
  894.         #if(A=10) #declare ZZ="----------+-+....................................." #end
  895.         #if(A=11) #declare ZZ="..........I.I....................................." #end
  896.         #if(A=12) #declare ZZ="----------+-+.............................I.I....." #end
  897.         #if(A=13) #declare ZZ="..........I.I.............................I.I....." #end
  898.         #if(A=14) #declare ZZ="..........I.I.............................I.I....." #end
  899.         #if(A=15) #declare ZZ="..........I.I.............................I.I....." #end
  900.         #if(A=16) #declare ZZ="..........I.I.............................I.I....." #end
  901.         #if(A=17) #declare ZZ="..........I.I.............................I.I....." #end
  902.         #if(A=18) #declare ZZ="..........I.I.............................I.I....." #end
  903.         #if(A=19) #declare ZZ="..........I.I.............................I.I....." #end
  904.         #if(A=20) #declare ZZ="..........I.I.............................I.I....." #end
  905.         #if(A=21) #declare ZZ="..........I.I.............................I.I....." #end
  906.         #if(A=22) #declare ZZ="..........I.I.............................I.I....." #end
  907.         #if(A=23) #declare ZZ="..........I.I.............................I.I....." #end
  908.         #if(A=24) #declare ZZ="..........I.I.............................I.I....." #end
  909.         #if(A=25) #declare ZZ="..........I.I.............................I.I....." #end
  910.         #if(A=26) #declare ZZ="..........I.I.............................I.I....." #end
  911.         #if(A=27) #declare ZZ="..........I.I.............................I.I....." #end
  912.         #if(A=28) #declare ZZ="..........I.I.............................I.I....." #end
  913.         #if(A=29) #declare ZZ="..........I.I.............................I.I....." #end
  914.         #if(A=30) #declare ZZ="..........I.I.............................I.I....." #end
  915.         #if(A=31) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  916.         #if(A=32) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  917.         #if(A=33) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  918.         #if(A=34) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  919.         #if(A=35) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  920.         #if(A=36) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  921.         #if(A=37) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  922.         #if(A=38) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  923.         #if(A=39) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  924.         #if(A=40) #declare ZZ="----------+-+-------------+-+-------------+-+-----" #end
  925.         #if(A=41) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  926.         #if(A=42) #declare ZZ="----------+-+-------------+-+-------------+-+-----" #end
  927.         #if(A=43) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  928.         #if(A=44) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  929.         #if(A=45) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  930.         #if(A=46) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  931.         #if(A=47) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  932.         #if(A=48) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  933.         #if(A=49) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  934.         #if(A=50) #declare ZZ="..........I.I.............I.I.............I.I....." #end
  935.         
  936.         // Now do something with that string.
  937.  
  938.         #declare X=1 #while(X<=50)
  939.         
  940.                 #declare TTTT = substr(ZZ,X,1)
  941.                 
  942.                 // Left to right.
  943.                 #declare MATCH1 = strcmp( TTTT, "-" )
  944.                 #if (MATCH1=0) object{Track_1
  945.                         translate<(X-1)*2,0,100-(A*2)>} #end
  946.  
  947.                 // Front to back..
  948.                 #declare MATCH2 = strcmp( TTTT, "I" )
  949.                 #if (MATCH2=0) object{Track_2
  950.                         translate<(X-1)*2,0,100-(A*2)>} #end
  951.  
  952.                 // Crossover.
  953.                 #declare MATCH3 = strcmp( TTTT, "+" )
  954.                 #if (MATCH3=0) object{Track_3
  955.                         translate<(X-1)*2,0,100-(A*2)>} #end
  956.  
  957.         #declare X=X+1 #end
  958.  
  959. #declare A=A+1 #end
  960.  
  961. #end // End of if block.
  962.  
  963.  
  964. ////////////////////////////////////////////////////////////
  965. ///////////////////////////////////////////////////////////
  966. //////////////////////////////////////////////////////////
  967. //
  968. // Bye!
  969.  
  970.